<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="wrap">
    <table>
        <tr>
            <th>姓名</th>
            <th>年龄</th>
            <th>性别</th>
        </tr>
        <tr>
            <td></td>
            <td></td>
            <td></td>
        </tr>
    </table>
    <p>今天讲课的老师是<b></b>,年龄<b></b>,是一位<b></b>老师哦！！！</p>
</div>
<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
<script>


    new Promise((resolve, reject)=>{
        $.ajax({
            type:"get",
            url:"https://www.easy-mock.com/mock/5d5c285ff29dd337a30351b1/view/",
            dataType:"json",
            success(msg){
                /**
                 * 适配1 将对象转换数组 {name,age,sex}
                 * @type {*[]}
                 */
                // msg = [msg.name,msg.age,msg.sex]

                /**
                 * 适配2[{name,age,sex},{name,age,sex},{name,age,sex},{name,age,sex},{name,age,sex}]
                 * @type {Array}
                 */

                let m = []
                msg.forEach(v=>{
                    m = [...m,...Object.values(v)]
                })
                resolve(m)
            },
            error(err){
                reject(err)
            }
        })
    }).then((msg)=>{
        $("table tr td").each(function (i) {
            $(this).html(msg.data.list[i])
        })
        $("p").children().each(function (i) {
            $(this).html(msg.data.list[i])
        })
    })

</script>
</body>
</html>